package com.example.questionnaire.pojo.DO;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;


@Data
@ApiModel("单选题类")
public class MultipleChoiceQuestion {

    @TableId(type = IdType.UUID)
    @ApiModelProperty("id")
    private String id;

    @ApiModelProperty("问卷id")
    private String formid;

    @ApiModelProperty("题型")
    private int questionType = 1;

    @ApiModelProperty("题号")
    private String subjectId;

    @ApiModelProperty("题目")
    private String title;

    @ApiModelProperty("是否必答")
    private int isMustAnswer;

    @ApiModelProperty("提示信息")
    private String tipContent;

    @ApiModelProperty("分组数据")
    private String  groupingArray;

//    @ApiModelProperty("选项分组id")
//    private int groupId;

    @ApiModelProperty("选项数据")
    private String optionArray;

    @ApiModelProperty("选项排列方式")
    private String numberOfOptions;

    @ApiModelProperty("跳题类型")
    private String jumpingType;
    @ApiModelProperty("跳题题号")
    private  String questionsJumpItems;
    @ApiModelProperty("是否开启分组")
    private  int isGroup;
    @ApiModelProperty("是否开启填写提示")
    private  int isWritePrompt;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)//在插入的时候自动填充
    private Date createTime;
    @ApiModelProperty("最后更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)////在插入和更新的时候自动填充
    private Date modifiedTime;

    @ApiModelProperty("逻辑删除")
    @TableLogic
    private Integer deleted;

    public MultipleChoiceQuestion() {
        questionType = 1;
    }

    public MultipleChoiceQuestion(int isMustAnswer, int isGroup, int isWritePrompt) {
        this.isMustAnswer = isMustAnswer;
        this.isGroup = isGroup;
        this.isWritePrompt = isWritePrompt;
    }

    public MultipleChoiceQuestion(String tipContent, String numberOfOptions, String jumpingType,String questionsJumpItems) {
        this.tipContent = tipContent;
        this.numberOfOptions = numberOfOptions;
        this.jumpingType = jumpingType;
        this.questionsJumpItems = questionsJumpItems;
    }

    public MultipleChoiceQuestion(String formid, String title, String subjectId, int isMustAnswer, int isWritePrompt, String tipContent, String groupingArray, String optionArray, String numberOfOptions, String jumpingType, String questionsJumpItems, int isGroup) {
        this.formid = formid;
        this.title = title;
        this.subjectId = subjectId;
        this.isMustAnswer = isMustAnswer;
        this.tipContent = tipContent;
        this.groupingArray = groupingArray;
        this.optionArray = optionArray;
        this.numberOfOptions = numberOfOptions;
        this.jumpingType = jumpingType;
        this.questionsJumpItems = questionsJumpItems;
        this.isGroup = isGroup;
        this.isWritePrompt = isWritePrompt;
    }

}
